#ifndef _LED_H_
#define _LED_H_
#include "Main.h"

#define LED_Red PORT_A_7
#define LED_Blue PORT_A_8
#define LED_Yellow PORT_A_10
#define LED_Orange PORT_C_0
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
#define Red_ON() MR88FX02_Gpio_Set(LED_Red, 1);
#define Blue_ON() MR88FX02_Gpio_Set(LED_Blue, 1);
#define Yellow_ON() MR88FX02_Gpio_Set(LED_Yellow, 1);
#define Orange_ON() MR88FX02_Gpio_Set(LED_Orange, 1);


#define Red_OFF() MR88FX02_Gpio_Set(LED_Red, 0);
#define Blue_OFF() MR88FX02_Gpio_Set(LED_Blue, 0);
#define Yellow_OFF() MR88FX02_Gpio_Set(LED_Yellow, 0);
#define Orange_OFF() MR88FX02_Gpio_Set(LED_Orange, 0);

#define SHANSHUO_TIME 200/2   //闪烁间隔时间


typedef struct
{
    int32_t Actual;
    int32_t Settings;   
    _Pt_Status Pt_Status;
}UI_Param_Typedef;

typedef struct 
{
	  UI_Param_Typedef RTD_Seq_RTD;
    UI_Param_Typedef Probe1;
    UI_Param_Typedef Probe2;
    UI_Param_Typedef Probe3;
    UI_Param_Typedef ProbePG;
    UI_Param_Typedef Timer1;

    uint8_t WIFI_Flag;
    uint8_t Blue_Flag;
    uint8_t Screen; //1:屏幕亮, 0:屏幕熄灭
    uint8_t Timer1_Colon; //1: 显示冒号, 0:不显示
//    Grill_State_E Grill_State;
//    Grill_Unit_E Grill_Unit; 
    uint8_t FlashSave;
 
    uint16_t UI_ShutdownCount;
    uint8_t PowerState; //ON(1):开机  OFF(0):关机
    uint16_t PowerUp_Delay; //Tick 2ms

}UI_System_S;



extern UI_System_S UI_System;

extern bool LED[19][16];

extern bool wifi_state;  //wifi状态显示
extern bool bluetooth_state;  //蓝牙状态显示
extern bool battery_state;  //电量状态显示

extern bool igniter_display_state;  //点火棒状态显示
extern bool motor_display_state;  //马达状态显示
extern bool fan_display_state;  //风扇状态显示
extern bool feed_display_state;  //进料状态显示
extern bool logo_state;  //logo状态显示
extern bool hengang_state;  //横杠状态显示
extern bool ACT_state;  //ACT状态显示
extern bool SET_state;  //SET状态显示
extern bool fire_state;  //火焰图标状态显示
extern bool P1_state;  //P1状态显示
extern bool P2_state;  //P1状态显示
extern bool P3_state;  //P1状态显示
extern bool Timer_state;  //定时状态显示
extern bool starving_state;  //缺料状态显示


extern bool wifi_OnOff;  //wifi闪烁
extern bool bluetooth_OnOff;  //蓝牙闪烁
extern bool igniter_OnOff;  //点火棒闪烁
extern bool motor_OnOff;  //马达闪烁
extern bool fan_OnOff;  //风扇闪烁
extern bool Temperature_Set_OnOff;  //温度设置闪烁
extern bool time_hour_OnOff;  //时设置闪烁
extern bool time_minute_OnOff;  //分设置闪烁
extern bool time_icon;   //时间图标  ：


extern bool temp_set_set; //1:设置温度正常显示，0：熄灭  不断切换达到闪烁效果
extern bool time_hour_set;  //1:定时 时 正常显示，0：熄灭  不断切换达到闪烁效果
extern bool time_minute_set;   //1:定时 分 正常显示，0：熄灭  不断切换达到闪烁效果

extern bool error;  //故障状态
extern bool Temperature_display_updata;

extern uint8_t Temp_icon_state; //温度图标状态 0，不显示  1，摄氏度  2，华氏度
extern uint8_t menu_key_state; //菜单按键图标状态 0，不显示  1，白色  2，蓝色
extern uint8_t feed_key_state; //进料按键图标状态 0，不显示  1，白色  2，蓝色
extern uint8_t Onoff_key_state; //开关按键图标状态 0，不显示  1，白色  2，蓝色

extern uint16_t Temperature;//温度
extern uint16_t Temperature_P1;//P1温度
extern uint16_t Temperature_P2;//P2温度
extern uint16_t Temperature_P3;//P3温度
extern uint16_t Temperature_P4;//P4温度
extern uint16_t Temperature_Set_display;//温度设置
extern uint8_t time_hour_display; //时间 时
extern uint8_t time_minute_display; //时间 分




void ALL_display(uint8_t state);
void Color_led_int(void);

#endif

